﻿package com.findMoneyGame.pages.home {
	
	import flash.events.Event;
	import flash.display.MovieClip;
	
	import com.findMoneyGame.models.Model;
	import com.findMoneyGame.models.User;
	import com.findMoneyGame.Engine;

	
	public class SeasonLabel extends MovieClip {

		private function get user () { return User.getInst(); }

		private function get season () { return int(user.level / Engine.LEVELS_PER_SEASON) + 1; }
		
		public function SeasonLabel() {
			user.addEventListener(Model.UPDATE, function (e : Event) { refresh(); });
			refresh();
		}
		private function refresh () { seasonLabel.text = 'Сезон №' + season.toString(); }

	}
	
}
